package 正则;


import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexDemo1 {
    /**
     * Pattern p = Pattern.compile("正则表达式");  //规则
     * Matcher m = p.matcher("需要进行匹配的的字符串")    //匹配器
     */
    public static void main(String[] args) {
        String regex1 = "[^0-9]";  // 不包括 0-9

        String str = "abc";
        Pattern p =  Pattern.compile(regex1);
        Matcher m = p.matcher(str);
        while(m.find()){
            System.out.print( m.start() + "----" + m.end() + "\t");
            System.out.println(m.group());
        }

    }

}
